home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 May
/
Macworld (1999-05).dmg
/
Shareware World
/
Utilities
/
Diagnostic
/
Trash•Desktop 1.2.1 (FAT)
/
AppleScript Examples
/
Trash All & Restart.as
< prev
Wrap
Text File
|
1999-01-29
|
945b
|
40 lines
property TrashDesktopFullPath : "000000000000000000000000000"
on run
--
-- Checks the TrashDesktopFullPath and asks for a valid path if an error occurs
--
try
get info for file TrashDesktopFullPath
on error
set TrashDesktopFullPath to (choose file with prompt ¬
"Choose Trash•Desktop program:" of type {"APPL"}) as string
end try
--
-- Make a volume's list of alias
--
set allVolumeList to {}
repeat with volumeName in list disks
set allVolumeList to allVolumeList & (volumeName & ":" as alias)
end repeat
if TrashDesktopFullPath is not "" then
try
--set TrashDesktop to the name of (info for file TrashDesktopFullPath)
--
-- Launch Trash•Desktop with all mounted volumes and then it quits automatically
--
launch application TrashDesktopFullPath
tell application TrashDesktopFullPath to open allVolumeList
tell application "Finder" to restart
on error
end try
end if
end run